package com.example.day07;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;

public class TryWithResources {
    public static void main(String[] args) {

        try {
            RandomAccessFile randomAccessFile = new RandomAccessFile("D:/test.txt", "rw");
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        }

        try (RandomAccessFile raf = new RandomAccessFile("D:/test.txt", "r")) {
            //...
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
